﻿using System;
using System.Collections.Generic;
using System.Text;

namespace xunsearch.lib
{
    public class xs_cmd
    {
        public const int CMD_NONE = 0;
        public const int CMD_DEFAULT = 0;
        public const int CMD_PROTOCOL = 20110707;
        public const int CMD_USE = 1;
        public const int CMD_HELLO = 1;
        public const int CMD_DEBUG = 2;
        public const int CMD_TIMEOUT = 3;
        public const int CMD_QUIT = 4;
        public const int CMD_INDEX_SET_DB = 32;
        public const int CMD_INDEX_GET_DB = 33;
        public const int CMD_INDEX_SUBMIT = 34;
        public const int CMD_INDEX_REMOVE = 35;
        public const int CMD_INDEX_EXDATA = 36;
        public const int CMD_INDEX_CLEAN_DB = 37;
        public const int CMD_DELETE_PROJECT = 38;
        public const int CMD_INDEX_COMMIT = 39;
        public const int CMD_INDEX_REBUILD = 40;
        public const int CMD_FLUSH_LOGGING = 41;
        public const int CMD_INDEX_SYNONYMS = 42;
        public const int CMD_INDEX_USER_DICT = 43;
        public const int CMD_SEARCH_DB_TOTAL = 64;
        public const int CMD_SEARCH_GET_TOTAL = 65;
        public const int CMD_SEARCH_GET_RESULT = 66;
        public const int CMD_SEARCH_SET_DB = CMD_INDEX_SET_DB;
        public const int CMD_SEARCH_GET_DB = CMD_INDEX_GET_DB;
        public const int CMD_SEARCH_ADD_DB = 68;
        public const int CMD_SEARCH_FINISH = 69;
        public const int CMD_SEARCH_DRAW_TPOOL = 70;
        public const int CMD_SEARCH_ADD_LOG = 71;
        public const int CMD_SEARCH_GET_SYNONYMS = 72;
        public const int CMD_SEARCH_SCWS_GET = 73;
        public const int CMD_QUERY_GET_STRING = 96;
        public const int CMD_QUERY_GET_TERMS = 97;
        public const int CMD_QUERY_GET_CORRECTED = 98;
        public const int CMD_QUERY_GET_EXPANDED = 99;
        public const int CMD_OK = 128;
        public const int CMD_ERR = 129;
        public const int CMD_SEARCH_RESULT_DOC = 140;
        public const int CMD_SEARCH_RESULT_FIELD = 141;
        public const int CMD_SEARCH_RESULT_FACETS = 142;
        public const int CMD_SEARCH_RESULT_MATCHED = 143;
        public const int CMD_DOC_TERM = 160;
        public const int CMD_DOC_VALUE = 161;
        public const int CMD_DOC_INDEX = 162;
        public const int CMD_INDEX_REQUEST = 163;
        public const int CMD_IMPORT_HEADER = 191;
        public const int CMD_SEARCH_SET_SORT = 192;
        public const int CMD_SEARCH_SET_CUT = 193;
        public const int CMD_SEARCH_SET_NUMERIC = 194;
        public const int CMD_SEARCH_SET_COLLAPSE = 195;
        public const int CMD_SEARCH_KEEPALIVE = 196;
        public const int CMD_SEARCH_SET_FACETS = 197;
        public const int CMD_SEARCH_SCWS_SET = 198;
        public const int CMD_SEARCH_SET_CUTOFF = 199;
        public const int CMD_SEARCH_SET_MISC = 200;
        public const int CMD_QUERY_INIT = 224;
        public const int CMD_QUERY_PARSE = 225;
        public const int CMD_QUERY_TERM = 226;
        public const int CMD_QUERY_RANGEPROC = 227;
        public const int CMD_QUERY_RANGE = 228;
        public const int CMD_QUERY_VALCMP = 229;
        public const int CMD_QUERY_PREFIX = 230;
        public const int CMD_QUERY_PARSEFLAG = 231;
        public const int CMD_SORT_TYPE_RELEVANCE = 0;
        public const int CMD_SORT_TYPE_DOCID = 1;
        public const int CMD_SORT_TYPE_VALUE = 2;
        public const int CMD_SORT_TYPE_MULTI = 3;
        public const int CMD_SORT_TYPE_MASK = 0x3f;
        public const int CMD_SORT_FLAG_RELEVANCE = 0x40;
        public const int CMD_SORT_FLAG_ASCENDING = 0x80;
        public const int CMD_QUERY_OP_AND = 0;
        public const int CMD_QUERY_OP_OR = 1;
        public const int CMD_QUERY_OP_AND_NOT = 2;
        public const int CMD_QUERY_OP_XOR = 3;
        public const int CMD_QUERY_OP_AND_MAYBE = 4;
        public const int CMD_QUERY_OP_FILTER = 5;
        public const int CMD_RANGE_PROC_STRING = 0;
        public const int CMD_RANGE_PROC_DATE = 1;
        public const int CMD_RANGE_PROC_NUMBER = 2;
        public const int CMD_VALCMP_LE = 0;
        public const int CMD_VALCMP_GE = 1;
        public const int CMD_PARSE_FLAG_BOOLEAN = 1;
        public const int CMD_PARSE_FLAG_PHRASE = 2;
        public const int CMD_PARSE_FLAG_LOVEHATE = 4;
        public const int CMD_PARSE_FLAG_BOOLEAN_ANY_CASE = 8;
        public const int CMD_PARSE_FLAG_WILDCARD = 16;
        public const int CMD_PARSE_FLAG_PURE_NOT = 32;
        public const int CMD_PARSE_FLAG_PARTIAL = 64;
        public const int CMD_PARSE_FLAG_SPELLING_CORRECTION = 128;
        public const int CMD_PARSE_FLAG_SYNONYM = 256;
        public const int CMD_PARSE_FLAG_AUTO_SYNONYMS = 512;
        public const int CMD_PARSE_FLAG_AUTO_MULTIWORD_SYNONYMS = 1536;
        public const int CMD_PREFIX_NORMAL = 0;
        public const int CMD_PREFIX_BOOLEAN = 1;
        public const int CMD_INDEX_WEIGHT_MASK = 0x3f;
        public const int CMD_INDEX_FLAG_WITHPOS = 0x40;
        public const int CMD_INDEX_FLAG_SAVEVALUE = 0x80;
        public const int CMD_INDEX_FLAG_CHECKSTEM = 0x80;
        public const int CMD_VALUE_FLAG_NUMERIC = 0x80;
        public const int CMD_INDEX_REQUEST_ADD = 0;
        public const int CMD_INDEX_REQUEST_UPDATE = 1;
        public const int CMD_INDEX_SYNONYMS_ADD = 0;
        public const int CMD_INDEX_SYNONYMS_DEL = 1;
        public const int CMD_SEARCH_MISC_SYN_SCALE = 1;
        public const int CMD_SEARCH_MISC_MATCHED_TERM = 2;
        public const int CMD_SCWS_GET_VERSION = 1;
        public const int CMD_SCWS_GET_RESULT = 2;
        public const int CMD_SCWS_GET_TOPS = 3;
        public const int CMD_SCWS_HAS_WORD = 4;
        public const int CMD_SCWS_GET_MULTI = 5;
        public const int CMD_SCWS_SET_IGNORE = 50;
        public const int CMD_SCWS_SET_MULTI = 51;
        public const int CMD_SCWS_SET_DUALITY = 52;
        public const int CMD_SCWS_SET_DICT = 53;
        public const int CMD_SCWS_ADD_DICT = 54;
        public const int CMD_ERR_UNKNOWN = 600;
        public const int CMD_ERR_NOPROJECT = 401;
        public const int CMD_ERR_TOOLONG = 402;
        public const int CMD_ERR_INVALIDCHAR = 403;
        public const int CMD_ERR_EMPTY = 404;
        public const int CMD_ERR_NOACTION = 405;
        public const int CMD_ERR_RUNNING = 406;
        public const int CMD_ERR_REBUILDING = 407;
        public const int CMD_ERR_WRONGPLACE = 450;
        public const int CMD_ERR_WRONGFORMAT = 451;
        public const int CMD_ERR_EMPTYQUERY = 452;
        public const int CMD_ERR_TIMEOUT = 501;
        public const int CMD_ERR_IOERR = 502;
        public const int CMD_ERR_NOMEM = 503;
        public const int CMD_ERR_BUSY = 504;
        public const int CMD_ERR_UNIMP = 505;
        public const int CMD_ERR_NODB = 506;
        public const int CMD_ERR_DBLOCKED = 507;
        public const int CMD_ERR_CREATE_HOME = 508;
        public const int CMD_ERR_INVALID_HOME = 509;
        public const int CMD_ERR_REMOVE_HOME = 510;
        public const int CMD_ERR_REMOVE_DB = 511;
        public const int CMD_ERR_STAT = 512;
        public const int CMD_ERR_OPEN_FILE = 513;
        public const int CMD_ERR_TASK_CANCELED = 514;
        public const int CMD_ERR_XAPIAN = 515;
        public const int CMD_OK_INFO = 200;
        public const int CMD_OK_PROJECT = 201;
        public const int CMD_OK_QUERY_STRING = 202;
        public const int CMD_OK_DB_TOTAL = 203;
        public const int CMD_OK_QUERY_TERMS = 204;
        public const int CMD_OK_QUERY_CORRECTED = 205;
        public const int CMD_OK_SEARCH_TOTAL = 206;
        public const int CMD_OK_RESULT_BEGIN = CMD_OK_SEARCH_TOTAL;
        public const int CMD_OK_RESULT_END = 207;
        public const int CMD_OK_TIMEOUT_SET = 208;
        public const int CMD_OK_FINISHED = 209;
        public const int CMD_OK_LOGGED = 210;
        public const int CMD_OK_RQST_FINISHED = 250;
        public const int CMD_OK_DB_CHANGED = 251;
        public const int CMD_OK_DB_INFO = 252;
        public const int CMD_OK_DB_CLEAN = 253;
        public const int CMD_OK_PROJECT_ADD = 254;
        public const int CMD_OK_PROJECT_DEL = 255;
        public const int CMD_OK_DB_COMMITED = 256;
        public const int CMD_OK_DB_REBUILD = 257;
        public const int CMD_OK_LOG_FLUSHED = 258;
        public const int CMD_OK_DICT_SAVED = 259;
        public const int CMD_OK_RESULT_SYNONYMS = 280;
        public const int CMD_OK_SCWS_RESULT = 290;
        public const int CMD_OK_SCWS_TOPS = 291;

    }
}
